﻿@using BootstrapSupport
@model IEnumerable<MovieFu.Models.Movie>

<table class="table table-striped">
    <caption></caption>
    <thead>
        <tr>
            <th>Title</th>
            <th>Description</th>
            <th>Release Year</th>
            <th>Director</th>
            <th></th>
        </tr>
    </thead>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @item.Title
            </td>
            <td>
                @item.Description
            </td>
            <td>
                @item.ReleaseYear
            </td>
            <td>
                @(item.Director == null ? "None" : item.Director.LastName)
            </td>
            <td>
                <div class="btn-group">
                    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Action
                       
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        @{
                             @Html.TryPartial("_actions", item)                            
                             var routevalues = item.GetIdValue();  

                            <li>@Html.ActionLink("Edit", "Edit", routevalues)</li>

                            <li>@Html.ActionLink("Details", "Details", routevalues)</li>

                            <li class="divider"></li>

                            <li>@Html.ActionLink("Delete", "Delete", routevalues)</li>
                               
 }
                    </ul>
                </div>

            </td>

        </tr>
    }



</table>
